﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Easy.Authorization.Business;
using Easy.Authorization.Models;
using Easy.Common.RegisterType;
using Easy.Common.Transaction;
using Easy.Common.Exceptions;


namespace Easy.Authorization.Service
{
    [ExceptionCallHandler]
    class Aut_NavigationsService : IAut_NavigationsService
    {
        Aut_NavigationsBusiness _Aut_NavigationsBusiness { get; set; }

        public Aut_NavigationsService(Aut_NavigationsBusiness Aut_NavigationsBusiness)
        {
            _Aut_NavigationsBusiness = Aut_NavigationsBusiness;
        }

        [TransactionCallHandler]
        public void Create(Aut_Navigations aut_User)
        {
            _Aut_NavigationsBusiness.CreateNew(aut_User);
        }

        [TransactionCallHandler]
        public void Update(Aut_Navigations aut_User)
        {
            _Aut_NavigationsBusiness.Update(aut_User);
        }

        [TransactionCallHandler]
        public void Delete(Guid aut_UserId)
        {
            _Aut_NavigationsBusiness.Delete(aut_UserId);
        }

        public IQueryable<VAut_Navigations> GetAll()
        {
            return _Aut_NavigationsBusiness.GetAll();
        }

        public IQueryable<VAut_Navigations> GetRoot()
        {
            return _Aut_NavigationsBusiness.GetRootNavigation();
        }

        public IQueryable<VAut_Navigations> GetChildren(string navigationDispaly)
        {
            return _Aut_NavigationsBusiness.GetChildrenNavigations(navigationDispaly);
        }
    }
}
